import { Button, Input } from "antd";
import { set } from "lodash";
import { useState, useReducer, useMemo, useCallback, memo } from "react";

const Child = memo((props)=>{
    console.log("Child渲染")
    return (
        <>
        <Input onChange={(e)=>props.iptChange(e.target.value)}></Input>
        </>
    )
})
const UseCallbackPage = () => {
    const [count, setCount] = useState(0)
    const iptChange = useCallback((e)=>{
        console.log("获取到",e)
    },[])
  
    return (
        <>
        <p>count的更新不会让child重新渲染</p>
           <Child iptChange={iptChange}></Child>
           <Button onClick={()=>setCount(count+1)}>{count}</Button>
        </>
    )
}
export default UseCallbackPage;